package com.dao.common;

import com.entity.common.TableInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by  qdf on 2019/3/11.
 */
@Mapper
@Repository
public interface TableInfoMapper {

    @Select("select TABLE_NAME tableName,TABLE_COMMENT tableComment from information_schema.tables where table_schema=(select database())")
     List<TableInfo> getTableInfo();

    @Select("select COLUMN_NAME columnName,COLUMN_COMMENT columnComment from information_schema.COLUMNS where table_name = #{tableName} and table_schema =( select database())")
     List<TableInfo> getColumnInfo(String tableName);
}
